<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>角色模块新增</title>
<body>
</head>
	<!-- form-box begin -->
	<div id="RoleModule_add_div" class="form-box" style="padding-top:10px;height: 85% " >
		<form id="RoleModule_add_form">
			<jsp:include page="vo/addVO.jsp"></jsp:include>
		</form>
	</div>
	<!-- form-box end -->
	<div id="divToolbar"  style=" margin-right :10px;  text-align: right">
		<a href="javascript:void(0)"  class="easyui-linkbutton button-blue l-btn l-btn-small" onclick="doSave()">保存</a>
		<a href="javascript:void(0)" class="easyui-linkbutton button-red l-btn l-btn-small" onclick="dialogClose()">关闭</a>
	</div>
	<script type="text/javascript">
	/** 关闭窗口*/
	function dialogClose() {
		/** 刷新父页面*/
		parent.doSearch();
		/** 关闭自己*/
		parent.doClose();
	}
	/** 保存方法*/
	function doSave() {
		/**验证数据**/
		if (!ValidateForm("#RoleModule_add_form")) {
			return;
		}
		$.ajax({
			url : "${base}/system/role/module/RoleModuleController/doSave",
			data : $("#RoleModule_add_form").serialize(),
			type : "POST",
			dataType : "JSON",
			cache : false,
			beforeSend : function(xhr) {
				/** 开启遮罩层次*/
				$.messager.progress({
					title: '提示',
					msg: '正在处理...请稍后...',
					text: ''
				});
			},
			complete : function(xhr, ts) {
				/** 关闭遮罩层*/
				$.messager.progress('close');
			},
			success : function(data) {
				var flag = data.flag;
				if (flag) { //验证成功
					$.messager.alert('提示', "保存成功", 'info', function() {
						dialogClose();
					});
				} else { //验证失败
					var msg = data.msg;
					$.messager.alert('保存失败', msg, 'error');
				}
			}
		});
	}
	</script>
</body>
</html>